home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
051-075
/
scopedisk68
/
iconmaker
/
ic.doc
< prev
next >
Wrap
Text File
|
1995-03-19
|
12KB
|
255 lines
This file describes the tool iconmaker version 1.2a. It has been developed
using 1.2 kickstart and has not been tested under 1.1 although
none of the new intuition or dos functions have been used.
This version is similar to 1.0 but includes an option called auto-icon that
selects the icon type to use based on the file extension (.ext). Thus
a directory of icons for .o, .c, .txt, .pic, .arc, etc. can be created
and easily used to create icons.
New in 1.2a is the ability to determine
some file types and find the appropriate icon template to use. Also, a
minor addition to the wildcard (toggle, un-select) and a double click to
info-pick picks files WITH icons.
Iconmaker builds icons for files that were created without them. Many
programs don't build icons when they create files using either a C
runtime system or the dos file primitives. This is because icon creation
requires extra program steps and it is difficult to create an in-memory
icon structure with C program statements (the icons's picture is
especially hard). However, if the program does have an icon file
available, then it is a rather simple matter to clone it. Iconmaker takes
this approach.
Iconmaker may be invoked by the cli or workbench. If it is run from the
cli, then it accepts zero or one argument: the name of a device and/or
directory to start with. If run from the workbench, then it also accepts
one argument (use extended selection: hold down the shift key and click
Iconmaker (first) and then double click another object). The second
object is used to determine the directory to begin with. Iconmaker
allows traversal up and down directory trees but cannot switch to another
device; hence, start up Iconmaker on the disk with which you want to
work. The default is to use the current directory if run from cli (with
zero args) and the directory that Iconmaker is in if from workbench.
When invoked, Iconmaker presents a requestor to the user as follows:
+-------------+---------------+ selected:directory/name
|make project | -> Project | +--+
|-------------+---------------| | | file 1
|make tool | -> Tool | | | file 2
|-------------+---------------| | | .
|make drawer | -> (x,y) | | | .
+-------------+---------------+ | | .
| | .
+-------------+---------------+ | |
|Dir Pick | Info pick | | |
|-------------+---------------| | |
|File Pick | Auto . icon | | |
|-------------+---------------| | |
|Read Dir | Read Parent | | |
|-------------+---------------| | |
|Refresh Dir | D-e-l-e-t-e | | |
+-------------+---------------+ +--+
+-----------------------------+ +------+ +------+ +------+ +------+
|Pattern | |quit | | all | | none | | quit |
| * | +------+ +------+ +------+ +------+
+-----------------------------+
+-----------------------------+
|Icon Template Pathnames |
|icons:|project|tool|drawer| |
+-----------------------------+
The gadget buttons direct the operations of iconmaker and the scrollable
file name display is used for the selection of files that are to have
icons created for them. There are also 2 text gadgets.
Iconmaker can create 3 types of icon files: project, tool, and drawer.
In order to do this, it needs to be able to find 3 template icon files.
The text requestor, Icon Template Pathnames, is for entering the location
of the icon files that will be used as the templates. This requestor is
initialized with the following:
icons:|project|tool|drawer|
which has 4 text strings separated by vertical bars (|). The first
(icons:) is a logical device name that can be defined to be equal to
another device name and optionally one or more directories. For example,
suppose there is a directory df0:icon_templates on the system disk. The
following cli statement will define icons:
assign icons: df0:icons_templates
Iconmaker would then look for 3 icon files,
icons:project.info
icons:tool.info
icons:drawer.info
which when the assignment icons: is expanded, would result in the file
names:
df0:icons_templates/project.info
df0:icons_templates/tool.info
df0:icons_templates/drawer.info
The easiest way to use Iconmaker is to have a directory which contains
template icons and use the startup-sequence file to make the assignment.
Note that if you want to use the workbench INFO option to edit the icons
tool-types, stack size, and default tool fields then you will need files
to go with the .info files. The files and drawer may be empty or not
since they are not used by Iconmaker.
You may also modify any of the strings in the text requestor. For
example, if you did not assign icons at the cli level, then you could
modify it in the text requestor directly as such:
df0:icons_templates/|project|tool|drawer|
Note the trailing slash (/). Iconmaker builds each of the three file
names by concatonating the first string with each of the following 3
strings and appending .info to form the three names.
Changing the names of the files is fine but there is one caveat. The
order of the names corresponds to the 3 types of icons. While it is ok to
use icons for tools and projects interchangably, you may not use either a
project or a tool icon for a drawer icon. To do so will cause a crash
when the drawer icon is clicked since drawer icon files have information
about a window to build. This information is missing in other icon types
and Iconmaker does not try to construct this information. Note that it is
not necessary to enter a return in this text requestor to have its
current contents be used.
When Iconmaker builds the new icon files, it always sets up the (x,y)
location of the icon with a special code that causes the Workbench to
place the icon in a window wherever it finds room. This is usually to be
preferred (at least by me) since it always will do the equivalent of a
clean-up operation after all the icons have been read for a drawer.
However, it causes the WB to not display any icons until all have been
read so it may present a blank window for some time. If you prefer to
have icons show up as usual, then you will have to use the WB option
snapshot. There is also an option to convert existing icon files to
auto-placement icons.
Once the locations of the template files have been determined, one may
set about to tell iconmaker which files need icons. There are 6ways to
select files. The files in the scroll area will initially be un-selected.
When they are selected, their color is complemented. Single files may be
selected by pointing at their name with the mouse and clicking the left
button. Any file that is already selected will become un-selected when
clicked. (Iconmaker handles the file selection by using gadgets for each
file name. This is slow, but by using blitzfonts or fastfonts it can
be made considerably faster.) The selection methods are:
The buttons ALL and NONE will select just that.
The buttons FILE PICK and DIR PICK are designed to select either files or
directories that -- do not -- have icons already. Thus, a file or
directory that has an associated .info file will not be selected.
However, if either of these two buttons are clicked two times in a
row, then they will select all files or directories. If selected
repeatedly, the result will toggle back to the first select.
The button INFO PICK will select all *.info files except the file .info
which is not a normal icon file. A second click of this button will
select all the files for which icon files already exist (including
directory files) and if selected again, will revert to a single click.
The three select buttons will first un-select all files.
The pattern requestor takes a * wildcard (as found on most other systems)
for multiple character wildcarding and ? for single character wildcards.
The pattern selects files in addition to any already selected files. The
selection takes place when the return key is typed. Multiple selections
may be made using the pattern gadget.
If the pattern begins with ! (bang) then the 2nd..last characters in the
pattern are used and the action is to De-select all matches.
If the pattern begins with ~ (tilde) then the 2nd..last characters in the
pattern are used and the action is to toggle the select for all matches.
Once a set of file has been selected, an operation may be performed. The
operations are:
Make PROJECT, TOOL, and DRAWER. These three operations make icon files.
Before using these operations, the corresponding files should be
selected. Do not make icon files for icon files; Iconmaker will not check
this.
Convert, denoted as -> , is used to change tool and project icons.
Only the icon type is changed, other information remains the same. The
option to convert (x,y) will set the icon files position to floating as
described above.
The DELETE FILES options may be used on any files, including directories,
but directories must be empty first. Deletion brings up a last chance
cancel requestor.
AUTO . ICON will try to make icons for all selected files and directories.
See below for more information.
The remaining operations are concerned with directory lookup operations.
The operation of REFRESH DIR will cause the current directory to be
re-read and displayed. Normally, when icons are created in the current
directory, the display is not updated for reasons of clarity and speed.
This option will make the directory current. The button READ PARENT will
set the directory up the tree one level and read that directory. The
button READ DIR will choose the first selected directory file and read
that directory.
Some operations are invalid and will cause a requestor to appear. When
one shows up with two OK buttons then the message is informational and
the operation will be aborted once either OK button is picked. If the
requestor shows an OK button and a CANCEL button then it means that one
of the picked files is inappropriate to the action requested (for example
make a project icon for a directory file). The OK button allows the
operation to proceed (but does not operate on the offending file) while
the CANCEL button will abort the operation on all remaining files that
were selected.
There are two QUIT buttons that have identical meanings.
===================
Auto Icon creation.
===================
New with this version of Icon Maker, is the auto icon create option.
This feature creates icons by using the part of the file name called the
extension. This is the tail end of a file name beginning with a dot. The
extension is used to select the icon file to use as the template. If
there is no icon found using the extension, then the file is opened, the
first 16 bytes read, and if it has the right header for an executable,
then the icon exe.info is used (if it exists). If the file is an IFF
file of type FORM, then the first header is used (in byte position 8..11
in the file); pictures contain ILBM, sound files SMUS, etc. If the file
type cannot be determined by reading it, then the icon misc.info is used
as a last gasp.
The text box that contains the template names is used to find the
directory where the templates exist.
For example,
arcfile.arc -> use icons:arc.info
picfile.pic -> use icons:pic.info
picture -> use icons:ILBM.info (if ilbm iff)
executeme -> use icons:exe.info (if runnable)
tune -> use icons:smus.info (if smus iff)
Note that the icon type is implicit in the .info file found. If the file
is a directory, then a check is made that the icon is also and if not
the drawer icon in the template directory is used instead.
NOTE: If an iff file has a type of less than 4 characters, the SPACES
at the end of the 1,2, or 3 characters IS significant and an icon
would have to be named with the spaces (e.g. "xxx "). The iff cracker
algorithm is VERY primitive, it may not work on all iff files - only
those with FORM in the first 4 bytes and some other 4 bytes in the
3rd longword.